]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensions: Ignore extensions in directories without read permission
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 2 Mar 2011 13:39:07 +0000 (14:39 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 2 Mar 2011 15:00:52 +0000 (16:00 +0100)
Gio.enumerate_children() throws an exception if called for a directory
without read permissions. Catch this case to allow the shell to start.

https://bugzilla.gnome.org/show_bug.cgi?id=643663

js/ui/extensionSystem.js

index 577328350cce9c42144ef8899730b9d0ae164fda..f2b88a53736b671a8f951f3ca73d7d6caa15c290 100644 (file)
@@ -174,8 +174,15 @@ function init() {
 }
 
 function _loadExtensionsIn(dir, type) {
-    let fileEnum = dir.enumerate_children('standard::*', Gio.FileQueryInfoFlags.NONE, null);
+    let fileEnum;
     let file, info;
+    try {
+        fileEnum = dir.enumerate_children('standard::*', Gio.FileQueryInfoFlags.NONE, null);
+    } catch (e) {
+        global.logError('' + e);
+       return;
+    }
+
     while ((info = fileEnum.next_file(null)) != null) {
         let fileType = info.get_file_type();
         if (fileType != Gio.FileType.DIRECTORY)